package com.gzz.utils;


import java.lang.reflect.Field;
import java.util.HashSet;
import java.util.Set;

public class JsonDataUtil {

	public static void main(String[] args) {
		Set<String> feild = getFeild(A.class);
		System.out.println(feild);

	}


	// 既然可以从对象中获取所有属性为什么又要转map呢

	public static Set<String> getFeild(Class<?> clazz){
		Field[] declaredField = clazz.getDeclaredFields();
		Set<String> res = new HashSet<>();
		for(Field f : declaredField){
			String name = f.getName();
			res.add(name);
		}

		return res;
	}

}



